package Week3.num.week3Test1.opp03;

public class EnglishStudent extends Student {
    /**
     * 英语演讲分数
     */
    private double speech;

    /**
     * 空参构造
     */
    public EnglishStudent() {

    }

    /**
     * 全参构造
     */
    public EnglishStudent(String stuId, String name, String gender, int age,
                          double midTermExam, double finalExam, double speech) {
        super(stuId, name, gender, age, midTermExam, finalExam);
        this.speech = speech;
    }

    /**
     * get和set方法
     */
    public double getSpeech() {
        return speech;
    }

    public void setSpeech(double speech) {
        this.speech = speech;
    }

    /**
     * 重写获取综合成绩的方法
     * @return 综合成绩
     */
    @Override
    public double score() {
        return (this.speech * 0.5 + this.getMidTermExam() * 0.25 + this.getFinalExam() * 0.25);
    }
}
